翻訳と辞書
Words near each other
・ Disinvestment
・ Disinvestment from Iran
・ Disinvestment from Israel
・ Disinvestment from South Africa
・ Disiz
・ DISJ
・ DisJam
・ Disjecta
・ Disjecta (Beckett)
・ Disjecta membra
・ Disjoining pressure
・ Disjoint
・ Disjoint sets
・ Disjoint union
・ Disjoint union (topology)
Disjoint-set data structure
・ Disjointed Parallels
・ Disjunct
・ Disjunct (linguistics)
・ Disjunct distribution
・ Disjunct matrix
・ Disjunction and existence properties
・ Disjunction elimination
・ Disjunction introduction
・ Disjunction property of Wallman
・ Disjunctive
・ Disjunctive cognition
・ Disjunctive graph
・ Disjunctive normal form
・ Disjunctive population


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Disjoint-set data structure : ウィキペディア英語版
Disjoint-set data structure

In computer science, a disjoint-set data structure, also called a union–find data structure or merge–find set, is a data structure that keeps track of a set of elements partitioned into a number of disjoint (nonoverlapping) subsets. It supports two useful operations:
* ''Find'': Determine which subset a particular element is in. ''Find'' typically returns an item from this set that serves as its "representative"; by comparing the result of two ''Find'' operations, one can determine whether two elements are in the same subset.
* ''Union'': Join two subsets into a single subset.
The other important operation, ''MakeSet'', which makes a set containing only a given element (a singleton), is generally trivial. With these three operations, many practical partitioning problems can be solved (see the ''Applications'' section).
In order to define these operations more precisely, some way of representing the sets is needed. One common approach is to select a fixed element of each set, called its ''representative'', to represent the set as a whole. Then, ''Find''(x) returns the representative of the set that ''x'' belongs to, and ''Union'' takes two set representatives as its arguments.
== Disjoint-set linked lists ==
A simple disjoint-set data structure uses a linked list for each set. The element at the head of each list is chosen as its representative.
''MakeSet'' creates a list of one element. ''Union'' appends the two lists, a constant-time operation if the list carries a pointer to its tail. The drawback of this implementation is that ''Find'' requires O(''n'') or linear time to traverse the list backwards from a given element to the head of the list.
This can be avoided by including in each linked list node a pointer to the head of the list; then ''Find'' takes constant time, since this pointer refers directly to the set representative. However, ''Union'' now has to update each element of the list being appended to make it point to the head of the new combined list, requiring Ω(''n'') time.
When the length of each list is tracked, the required time can be improved by always appending the smaller list to the longer. Using this ''weighted-union heuristic'', a sequence of ''m'' ''MakeSet'', ''Union'', and ''Find'' operations on ''n'' elements requires O(''m'' + ''n''log ''n'') time. For asymptotically faster operations, a different data structure is needed.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Disjoint-set data structure」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.